import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import router from './router';
import axios from 'axios';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

const app = createApp(App);

// 后端地址
const API_BASE_URL = 'http://localhost:8080';

// 配置 axios
axios.defaults.baseURL = API_BASE_URL;
app.config.globalProperties.$axios = axios;

// 配置 Pinia
const pinia = createPinia();
app.use(pinia);

// 使用 Element Plus
app.use(ElementPlus);

app.use(router).mount('#app');